package org.linuxsogood.boot.jdbc;

import java.sql.*;

/**
 * @author honway.liu
 * @date 2018/8/17 下午8:40
 * @email gm100861@gmail.com
 * @blog http://linuxsogood.org
 */
public class Demo {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        TestInit testInit = new TestInit();
        System.out.println("init end");
        Class.forName("org.linuxsogood.boot.jdbc.TestInit");
        Class.forName("com.mysql.jdbc.Driver");
        TestInit.say();
        Connection connection = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/springboot", "root", "redhat");
        PreparedStatement statement = connection.prepareStatement("select * from tag");
        ResultSet resultSet = statement.executeQuery();
        while (resultSet.next()) {
            //do something
        }

    }
}
